package com.question.common.annotation;

import com.question.common.valid.DictValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 枚举校验
 *
 * @author star
 * @since 2021-12-29
 */
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {DictValidator.class})
public @interface DictValid {

    String message();

    String type();

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
